package 蓝桥._14届.互质数的个数;

import java.util.Scanner;

public class Main3 {

    // 欧拉函数
    static long phi(long x){
        long res = x;
        for(int i=2;i<=x/i;i++){
            if(x%i==0){
                res = res/i *(i-1);
                // 除尽所有幂次
                while(x%i==0) x/=i;
            }
        }
        if(x>1) res = res / x *(x-1);
        return res;
    }
    static long mod = 998244353;
    // 快速幂
    static long quick_pow(long base,long pow,long mod){
        long t = base, res = 1;
        while (pow>0){
            if(pow%2==1)
                res = res*t%mod;
            t = t*t%mod;
            pow = pow>>1;
        }
        return res;
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        long a = scan.nextLong(), b = scan.nextLong();
        long phi_a = phi(a);
        long a_b_1 = quick_pow(a,b-1,mod);
        System.out.println(phi_a*a_b_1%mod);
        scan.close();

    }
}
